package ext.wang.dao;

import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;

public class TestDao {

	private JdbcTemplate jdbcTemplate;

	public void setDataSource(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}

	public int test() {
		// queryForInt
		String sql = "select count(*) from menus ";
		int counts = 0;

		counts = jdbcTemplate.queryForInt(sql);

		return counts;

	}
}
